import React from 'react';
import { MModal } from '@block/mobile-plug';
import { Table } from '@ss/mtd-react';
import { LevelTableRow } from '../../type';
import './AuditLevelModal.scss';

interface Props {
  onClose: () => void;
  levelTable: LevelTableRow[];
}

/**
 * 审计报告等级定义弹窗
 * pc端为弹出框&h5为上滑抽屉
 */

const AuditLevelModal = (props: Props) => {
  const { levelTable, onClose } = props;
  return (
    <MModal className="modal-content" mode="modal2drawer" title="审计报告重要性等级定义" onClose={onClose}>
      <MModal.Body>
        <Table useSticky rowKey="code" data={levelTable}>
          <Table.Column dataKey="name" width="100" render={(value) => value ?? '-'}>
            等级
          </Table.Column>
          <Table.Column dataKey="standard" width="140" render={(value) => value ?? '-'}>
            评级标准
          </Table.Column>
          <Table.Column dataKey="rectifyContent" width="140" render={(value) => value ?? '-'}>
            管理层需改进行动
          </Table.Column>
        </Table>
      </MModal.Body>
    </MModal>
  );
};
export default AuditLevelModal;
